<?php
$skey = $_REQUEST["skey"];

$qq = $_REQUEST["qq"];
$cook = $_REQUEST["cook"];
$qqq = $_REQUEST["qqq"];
$hash = 5381;

for($i=0;$i<strlen($skey);$i++){
  	$aaa = $hash << 5; 
  	$bbb = ord($skey{$i});
    $hash = $hash + $aaa + $bbb;
}
//echo $hash."</br>";
$hash = $hash & 2147483647;
echo $hash;
//
//echo curl_get("http://qun.qzone.qq.com/cgi-bin/get_group_member?callbackFun=_GroupMember_temp&uin=$qq&groupid=465247425&g_tk=$hash");
//echo curl_get("http://qun.qzone.qq.com/cgi-bin/get_group_list?groupcount=4&count=4&callbackFun=_GetGroupPortal&uin=$qq&g_tk=$hash&ua=Mozilla%2F4.0%20(compatible%3B%20MSIE%208.0%3B%20Windows%20NT%205.1%3B%20Trident%2F4.0%3B%20.NET%20CLR%202.0.50727)");

function curl_get($url){
    $curl = curl_init(); 							// 启动一个CURL会话
    curl_setopt($curl, CURLOPT_URL, $url); 			// 要访问的地址
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);	// 对认证证书来源的检查
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);	// 使用自动跳转
    curl_setopt($curl, CURLOPT_AUTOREFERER, 0);		// 自动设置Referer
    curl_setopt($curl, CURLOPT_TIMEOUT, 30); 		// 设置超时限制防止死循环
    curl_setopt($curl, CURLOPT_HEADER, 0); 			// 显示返回的Header区域内容
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 	// 获取的信息以文件流的形式返回
    $data = curl_exec($curl); 						// 执行操作
    curl_close($curl); 								// 关键CURL会话
    return $data;
}
?>